package com.tian.source.service.impl;

import com.tian.core.page.Page;
import com.tian.source.mapper.DictionaryMapper;
import com.tian.source.model.Dictionary;
import com.tian.source.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * @author YangTao
 * @date 2025/4/18
 */
@Service
public class DictionaryServiceImpl implements DictionaryService{

	@Autowired
	private DictionaryMapper dictionaryMapper;

	/**
	 * 获取数据库表中所有列转换为对应的实例对象并返回集合
	 *
	 * @return List<Dictionary>
	 */
    @Override
	public List<Dictionary> getAll() {
		return dictionaryMapper.getAll();
	}


   /**
    * 分页查询
    *
    * @param map
    * @return
    */
    @Override
   public Page<List<Dictionary>> findPage(Page page,Map<String,Object> map)
   {
	   return dictionaryMapper.findPage(page,map);
   }



	/**
	 * 通过ID主键查询出实体对象
     *
	 * @param id  主键
	 * @return Dictionary  实体对象
	 */
    @Override
	public  Dictionary findById(Integer id){
		return dictionaryMapper.findById(id);
	}

	/**
	 * 新增一实例插入到数据库表中
	 *
	 * @param  dictionary
	 * @return Dictionary
	 */
    @Override
	public Integer add(Dictionary dictionary) {
		 return dictionaryMapper.add(dictionary);
	}


	/**
	 * 根据主键修改实例对象内容
	 *
	 * @param  dictionary
	 * @return Dictionary
	 */
    @Override
	public void modifyById(Dictionary dictionary) {
		dictionaryMapper.modifyById(dictionary);
	}


	/**
	 * 删除一实例对象
	 *
	 * @param  dictionary
	 * @return List<Dictionary>
	 */
    @Override
	public void delete(Dictionary dictionary) {
		 dictionaryMapper.delete(dictionary);
	}


	/**
	 * 通过主键删除对象
	 *
	 * @param id  主键
	 */
    @Override
	public void deleteById(Integer id) {
		 dictionaryMapper.deleteById(id);
	}

	@Override
	public List<Dictionary> findEmployeeStatus() {
		return dictionaryMapper.findEmployeeStatus();
	}
}
